<h1 id ="page_title">Klotterplanket</h1>
<div id="entries">
<ul>
<?php  if(isset($rows) && count($rows) > 0) : foreach($rows as $row) : ?>  
  <li class="
	<?php if($row->moodID=="1"){echo "glad";} 
		else if($row->moodID=="2"){echo "ledsen";} 
		else if($row->moodID=="3"){echo "arg";}
		else if($row->moodID=="4"){echo "irriterad";}?> ">  
    
		<p class="date"> <?php echo $row->date; ?></p>
		<p class="headline"> <?php echo $row->headline; ?></p>
		<p class="text" > <?php echo $row->text; ?></p>
		<p class="author"> <?php echo $row->author; ?></p>
		<p class="categoryName"> <?php echo $row->categoryName; ?></p>
		<p class="moodName"> <?php echo $row->moodName; ?></p>
		<p class="edit"> <?php echo anchor("site/edit_entry/$row->entryID", 'Ändra'); ?></p>
		<?php $url = base_url() .'site/get_entry/'.$row->entryID; ?>
   		<a href="https://twitter.com/share" class="twitter-share-button" data-text="Läs det här klottret: " 
    	data-url ="<?php echo $url ?>"
    	data-lang="en">Tweet</a>
		<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
	</li>
<?php endforeach; ?>
	<?php else : ?>	
		<h2>No records were returned.</h2>
	<?php endif; ?>
	</ul>
</div>
	